package com.journey.org.ui.test

import android.app.Application
import android.content.Intent
import android.net.Uri
import com.mvvmhabit.org.base.BaseViewModel
import com.mvvmhabit.org.binding.command.BindingAction
import com.mvvmhabit.org.binding.command.BindingCommand

class ContinuousCallViewModel(application: Application) : BaseViewModel(application) {

    val onCallCommand = BindingCommand<Any>(object : BindingAction {
        override fun call() {
            callPhone("18275554434")

        }
    })


    fun callPhone(phone: String) {
        val intent = Intent(Intent.ACTION_CALL)
        val data = Uri.parse("tel:$phone")
        intent.data = data
        startActivity(intent)
    }



}